<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="/template/OutletManagementTemplate.xhtml">

    <ui:define name="contentInsert">
        <h:form id="customerEmail">
            <h:panelGrid columns="4">
                <h:outputLabel value="Enter customer email: " />
                <h:inputText id="email" value="#{reservationManagedBean.customerEmail}"/>
                <p:message for="email"/>
                <p:commandButton id="emailSubmit" value="Submit" ajax="false"
                                 update="reservationList" >
                </p:commandButton>
            </h:panelGrid>

            <p:dataTable var="reservation" value="#{reservationManagedBean.reservationByCus}" id="reservationList">
                <f:facet name="header" >
                    <h:outputText value="#{reservationManagedBean.customerEmail}"/>
                </f:facet>
                <p:column headerText="Id" style="width:15%">
                    <h:outputText value="#{reservation.id}"/>
                </p:column>
                <p:column headerText="Time" style="width:150px" sortBy="#{reservation.timeslot.time}">
                    <h:outputText value="#{reservation.timeslot.time}"/>
                </p:column>
                <p:column headerText="Area" style="width:10%" >
                    <h:outputText value="#{reservation.area.areaName}"/>
                </p:column>
                <p:column headerText="Confirm status" style="width:150px" >
                    <h:outputText value="#{reservation.statusStr}"/>
                </p:column>

                <p:column headerText="Option" style="width:5px">
                    <p:commandButton id="button" value="Show Up" ajax="false" 
                                     actionListener="#{reservationManagedBean.recordShowUp}" 
                                     update="display" disabled="#{reservation.customerShowUp}">
                        <f:attribute name="rId" value="#{reservation.id}" />
                    </p:commandButton>
                </p:column>

            </p:dataTable>  
        </h:form>
    </ui:define>
</ui:composition>